package com.yn.courseselectionsystem.controller;

import com.yn.courseselectionsystem.pojo.Semester;
import com.yn.courseselectionsystem.service.impl.SemesterServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * @description: TODO
 * @author: Tokyo_God
 * @date: 2020/12/30 18:47
 * Role of:
 * @version: v1.0
 */
@Controller
public class SemesterController {
    @Autowired
    SemesterServiceImpl semesterService;

    /**
     * 获取所以的学期以List的格式
     * @return
     */
    @GetMapping("/semester/selSemesterAll")
    @ResponseBody
    public List<Semester> selSemesterAll(){
        return semesterService.selSemesterAll();
    }

    /**
     * 获取所以的学期以Map的格式
     * @return
     */
    @GetMapping("/semester/selSemesterMapAll")
    @ResponseBody
    public Map<Integer,Semester> selSemesterMapAll(){
        return semesterService.selSemesterMapAll();
    }
}
